📘 Free CERTIFIED-ASSOCIATE-DEVELOPER-FOR-APACHE-SPARK Sample Questions
Which of the following describes the Spark driver?
A
The Spark driver is responsible for performing all execution in all execution modes – it is the entire Spark
application
B
The Spare driver is fault tolerant – if it fails, it will recover the entire Spark application
C
The Spark driver is the coarsest level of the Spark execution hierarchy – it is synonymous with the Spark
application.
D
The Spark driver is the program space in which the Spark application’s main method runs coordinating the
Spark entire application
Correct Answer:
D. The Spark driver is the program space in which the Spark application’s main method runs coordinating the
Spark entire application
Explanation:
The Spark driver is the program space in which the Spark application’s main method runs coordinating the
Spark entire application.
Which of the following describes the relationship between nodes and executors?
A
Executors and nodes are not related.
B
Anode is a processing engine running on an executor.
C
An executor is a processing engine running on a node
D
There are always the same number of executors and nodes.
Correct Answer:
C. An executor is a processing engine running on a node
Explanation:
In a Spark cluster, each node typically has multiple executors, which are responsible for executing tasks on
that node. An executor is a separate process that runs on a node and is responsible for executing tasks
assigned to it by the driver. Therefore, a node can have multiple executors running on it. The number of
executors on a node depends on the resources available on that node and the configuration settings of the
Spark application. So, option C is the correct answer.
Which of the following will occur if there are more slots than there are tasks?
A
The Spark job will likely not run as efficiently as possible.
B
The Spark application will fail - there must be at least as many tasks as there are slots.
C
Some executors will shut down and allocate all slots on larger executors first.
D
More tasks will be automatically generated to ensure all slots are being used.
Correct Answer:
D. More tasks will be automatically generated to ensure all slots are being used.
Which of the following is the most granular level of the Spark execution hierarchy?
A
Task
B
Executor
C
Node
D
Job
Correct Answer:
A. Task
Which of the following statements about Spark jobs is incorrect?
A
Jobs are broken down into stages.
B
There are multiple tasks within a single job when a DataFrame has more than one partition.
C
Jobs are collections of tasks that are divided up based on when an action is called.
D
There is no way to monitor the progress of a job.
Correct Answer:
D. There is no way to monitor the progress of a job.
The code block shown below should read a parquet at the file path filePath into a DataFrame. Choose the response
that correctly fills in the numbered blanks within the code block to complete this task.
Code block:
_1 . 2 . 3 ( 4)
A
A.1. spark
2. read()
3. parquet
4. filePath
B
B.1. spark
2. read()
3. load
4. filePath
C
C.1. spark
2. read
3. load
4. filePath, source = "parquet"
D
D.1. storesDF
2. read()
3. load
4. filePath
E
E.1. spark
2. read
3. load
4. filePath
Correct Answer:
E. E.1. spark
2. read
3. load
4. filePath
Explanation:
1. spark
2. read
3. load
4. filePath
Which of the following code blocks returns a DataFrame containing a column month, an integer representation of
the month from column openDate from DataFrame storesDF?
Note that column openDate is of type integer and represents a date in the UNIX epoch format — the number of
seconds since midnight on January 1 st, 1970.
A sample of storesDF is displayed below:
A
storesDF.withColumn("month", getMonth(col("openDate")))
B
.storesDF.withColumn("month", substr(col("openDate"), 4, 2))
C
(storesDF.withColumn("openDateFormat", col("openDate").cast("Date"))
.withColumn("month", month(col("openDateFormat"))))
D
(storesDF.withColumn("openTimestamp", col("openDate").cast("Timestamp"))
.withColumn("month", month(col("openTimestamp"))))
Correct Answer:
D. (storesDF.withColumn("openTimestamp", col("openDate").cast("Timestamp"))
.withColumn("month", month(col("openTimestamp"))))
Which of the following operations is most likely to result in a shuffle?
A
DataFrame.join()
B
DataFrame.filter()
C
DataFrame.union()
D
DataFrame.where()
Correct Answer:
A. DataFrame.join()
Which of the following operations will always return a new DataFrame with updated partitions from DataFrame
storesDF by inducing a shuffle?
A
A.storesDF.coalesce()
B
B.storesDF.rdd.getNumPartitions()
C
C.storesDF.repartition()
D
D.storesDF.union()
E
E.storesDF.intersect()
Correct Answer:
C. C.storesDF.repartition()
The default value of spark.sql.shuffle.partitions is 200. Which of the following describes what that means?
A
By default, all DataFrames in Spark will be spit to perfectly fill the memory of 200 executors.
B
By default, new DataFrames created by Spark will be split to perfectly fill the memory of 200 executors.
C
By default, Spark will only read the first 200 partitions of DataFrames to improve speed.
D
By default, all DataFrames in Spark, including existing DataFrames, will be split into 200 unique segments
for parallelization.
E
By default, DataFrames will be split into 200 unique partitions when data is being shuffled.
Correct Answer:
E. By default, DataFrames will be split into 200 unique partitions when data is being shuffled.
Questions: 1-10 out of 173
Continue Full Practice..
GET ALL 173 QUESTIONS